Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix money returns caused by an account shrinking #1173

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

kstepanovdev
Copy link
Contributor

added the possibility to return lamports after an account has been shrunk

@kstepanovdev kstepanovdev self-assigned this Feb 29, 2024
@kstepanovdev kstepanovdev requested a review from a team as a code owner February 29, 2024 01:48
@nhanphan nhanphan self-requested a review March 4, 2024 23:38
Copy link
Contributor

@nhanphan nhanphan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when shrinking the target account, it may or may not be owned by the system program so the transfer may not work

@blockiosaurus
Copy link
Contributor

You'll want to do the system program shrink transfer if the account is system program owned but manual lamport math otherwise.

Welcome to the confusing world of Solana programming 😁

@kstepanovdev kstepanovdev requested review from nhanphan and danenbm March 5, 2024 16:27
@kstepanovdev kstepanovdev force-pushed the fixed-resize-or-realloc-raw branch from ef06abb to 777df49 Compare March 5, 2024 17:33
@kstepanovdev kstepanovdev force-pushed the fixed-resize-or-realloc-raw branch from 777df49 to 7046136 Compare March 5, 2024 17:34
Copy link
Contributor

@blockiosaurus blockiosaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment but otherwise this is good!

Copy link
Contributor

@danenbm danenbm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kstepanovdev kstepanovdev merged commit 7dab5d1 into master Mar 19, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants